home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / srch_rs.exe / SEARCH.PAS < prev    next >
Pascal/Delphi Source File  |  1992-01-17  |  2KB  |  40 lines

  1.  
  2. unit Search;       (* Fast sequential byte/string searching routines. *)
  3.                    (* Data-type you are searching must be 64K or less *)
  4.                    (* in size.                                        *)
  5.                    (* Donated to the public domain by Reuben Sumner.  *)
  6.  
  7. interface
  8.                    (* Function to find a byte within a sequential     *)
  9.                    (* data-type. (Maximum 64K for data-type.)         *)
  10.                    (* Data is the data-type you want to search,       *)
  11.                    (* Size is the size in bytes of the data-type      *)
  12.                    (* you want to search, Num is the byte you are     *)
  13.                    (* looking for. Returns the byte offset if found,  *)
  14.                    (* zero if not found.                              *)
  15.  
  16.   function FindByte(var Data; Size : word; Num : byte) : word;
  17.  
  18.  
  19.                    (* Fuction to find a string within a sequential    *)
  20.                    (* data-type. (Maximum 64K for data-type.)         *)
  21.                    (* Data is the data-type you want to search,       *)
  22.                    (* Size is the size in bytes of the data-type      *)
  23.                    (* you want to search, St is the string you are    *)
  24.                    (* looking for. Returns the byte offset if found,  *)
  25.                    (* zero if not found.                              *)
  26.  
  27.   function StrPos(var Data; Size : word; St : string) : word;
  28.  
  29. implementation
  30.  
  31. {$L SEARCH.OBJ}
  32.  
  33. {$F+}
  34.   function FindByte(var Data; Size : word; Num : byte) : word; external;
  35.   function StrPos(var Data; Size : word; St : string) : word; external;
  36. {$F-}
  37.  
  38. END.
  39.  
  40.